//
//  UIViewController+MyUtil.h
// jqb_v2
//
//  Created by dev on 14-7-9.
//  Copyright (c) 2014年 EFunds. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MBProgressHUD.h"

@interface UIViewController (MyUtil)<MBProgressHUDDelegate>

/**
 *@brief 弹出对话框
 */
- (void)showAlertMsg:(NSString *)msg;

/**
 *@brief 弹出对话框
 */
- (void)showAlertWithTitle:(NSString *)title msg:(NSString *)msg;

/**
 *  弹出Toast消息
 *
 *  @param toast <#toast description#>
 */
- (void)showToast:(NSString *)toast;

/**
 *  弹出Toast消息
 *
 *  @param toast    <#toast description#>
 *  @param inWindos <#inWindos description#>
 */
- (void)showToast:(NSString *)toast inWindow:(BOOL)inWindos;

/**
 *  toast
 *
 *  @param toast 提示信息内容
 *  @param dur   显示的持续时间
 */
- (void)showToast:(NSString *)toast duration:(CGFloat)dur;

/**
 *  支持执行block的toast
 *
 *  @param toast      提示信息内容
 *  @param dur        显示的持续时间
 *  @param completion 需要执行的block
 */
- (void)showToast:(NSString *)toast
         duration:(CGFloat)dur
  completionBlack:(void (^)(void))completion;

/**
 *  processHUD
 *
 *  @param text 需要显示的内容
 */
- (void)showProcessHUD:(NSString *)text;
/**
 *  在特定的view中显示processHUD，用于个别场合
 *
 *  @param text <#text description#>
 *  @param View <#View description#>
 */
-(void)showProcessHUD:(NSString *)text inView:(UIView *)view;

/**
 *  processHUD with completionBlock
 *
 *  @param text       需要显示的内容
 *  @param completion completionBlock
 */
- (void)showProcessHUD:(NSString *)text completionBlock:(void (^)(void))completion;

- (void)showProcessHUDWithProcessValue:(CGFloat)value title:(NSString *)title;// withCompleteBlock:(void (^)())completeBlock;

/**
 *  取消processHUD
 */
- (void)hideProcessHUD;

/**
 *  从storyboard中获得viewcontroller对象
 */
+ (id)viewControllerWithStoryBoard:(NSString *)sbName identify:(NSString *)identify;

/**
 *    是否为正在显示的viewController
 *
 *    @return <#return value description#>
 */
- (BOOL)isCurrentViewController;

@end

@interface UINavigationController(Replace)

- (void)replaceCurrViewControllerWithViewCtl:(UIViewController *)viewCtl animate:(BOOL)animate;

@end
